{% extends 'TopxiaWebBundle:Settings:layout.html.twig' %}
{% block title %}设置支付密码 - 安全设置 - {{ parent() }}{% endblock %}
{% set script_controller = 'settings/reset_pay_password' %} 
{% set side_nav = 'security' %} 

{% block main %} 
 {% embed "TopxiaWebBundle:Bootstrap:panel.html.twig" with {class:'panel-col'} %}
    {% block heading %}
      安全设置
    {% endblock %}
    {% block body %}

      <ul class="breadcrumb">
        <li><a href="{{ path('settings_security') }}">安全设置</a></li>
        <li class="active">设置支付密码</li>
      </ul>


      {% if not app.user.password %}
        <div class="alert alert-warning">
          <p>当前帐号从第三方帐号直接登录时创建，尚未设置登录密码。</p>
          <p>为了帐号的安全，请通过邮箱找回密码的方式，重设登录密码！</p>
          <p><a href="{{ path('password_reset') }}" class="btn btn-primary">现在就去重设登录密码！</a></p>
        </div>
      {% endif %}

      <form id="settings-pay-password-form" class="form-horizontal" method="post" {% if not app.user.password %} style="display:none;"{% endif %}>

        {{ web_macro.flash_messages() }}
        
        {# <div class="form-group">
          <div class="col-md-3 control-label">{{ form_label(form.currentUserLoginPassword, '用户登录密码') }}</div>
          <div class="controls col-md-8 controls">
            {{ form_widget(form.currentUserLoginPassword, {attr:{class:'form-control'}}) }}
          </div>
        </div> #}

        <div class="form-group">
          <div class="col-md-3 control-label">
              {{ form_label(form.oldPayPassword, '旧的支付密码') }}               
          </div>
          <div class="controls col-md-8 controls">
            {{ form_widget(form.oldPayPassword, {attr:{class:'form-control'}}) }}
            <a href="{{ path('settings_find_pay_password') }}" class="help-block text-muted" >忘记支付密码？</a>
          </div>
        </div>

        <div class="form-group">
          <div class="col-md-3 control-label">{{ form_label(form.newPayPassword, '新支付密码') }}</div>
          <div class="controls col-md-8 controls">
            {{ form_widget(form.newPayPassword, {attr:{class:'form-control'}}) }}
          </div>
        </div>

        <div class="form-group">
          <div class="col-md-3 control-label">{{ form_label(form.confirmPayPassword, '确认支付密码') }}</div>
          <div class="controls col-md-8 controls">
            {{ form_widget(form.confirmPayPassword, {attr:{class:'form-control'}}) }}
          </div>
        </div>

        <div class="form-group">
          <div class="col-md-3 control-label"></div>
          <div class="controls col-md-8 controls">
            {{ form_rest(form) }}
            <button id="password-save-btn" data-submiting-text="正在保存" type="submit" class="btn btn-primary">提交</button>
          </div>
        </div>

        <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">

      </form>


    {% endblock %}
  {% endembed %}
{% endblock %}